import React,{ Component } from 'react';
import listyle from '../css/indexCenter.css';
export default class IndexItem extends React.Component{
	handleOver(){
		let hoverDiv = React.findDOMNode(this.refs.hoverDiv);
		$(hoverDiv).stop().fadeIn("slow");
	}
	handleOverLeave(){
		let hoverDiv = React.findDOMNode(this.refs.hoverDiv);
		$(hoverDiv).stop().fadeOut("slow");
	}
    render(){
		let itemli = this.props.items;
		let href = "./demo.html?cId="+itemli["id"]+"&belongto="+itemli["belongto"];
		return (
			<a href={href} target="_blank">
				<li onMouseEnter ={this.handleOver.bind(this)} onMouseLeave ={this.handleOverLeave.bind(this)} data-id={itemli.id} data-belongto={itemli.belongto}>
					<div ref="hoverDiv" className={listyle.hoverDiv}>
						<span>{itemli.uploader}</span>
						<span>发布时间:{itemli.uploadTime}</span>
					</div>
					<span>{itemli.name}</span>
				</li>
			</a>
		);
    }
}
